using System;
using System.Data.Linq.Mapping;
using CoreLibrary;
using CoreLibrary.Date;

namespace Entities.DataBase.Persistent {

    [Table(Name = "D_PRODUCT")]
    public class Product {

        public Product() {
            ProductId   = GuidUtil.GuidN();
            DateCreated = DateTime.UtcNow;
            DateUpdated = DateUtil.Epoch;
            Enabled     = true;
            Color       = string.Empty;
            Description = string.Empty;
            Keywords    = string.Empty;
            Thumbs      = string.Empty;
            Images      = string.Empty;
            Data        = string.Empty;
            WeightUnit  = string.Empty;
            CreatorId   = string.Empty;
            ListOrder   = 0;
        }

        /// <summary>
        /// 1. Unique Product ID
        /// </summary>
        [Column(Name = "ID", IsPrimaryKey = true)]
        public string ProductId { get; set; }

        /// <summary>
        /// 2. Product Catalog ID
        /// </summary>
        [Column(Name = "CATALOG_ID")]
        public int CatalogId { get; set; }

        /// <summary>
        /// 3. Product English Name
        /// </summary>
        [Column(Name = "NAME")]
        public string Name { get; set; }

        /// <summary>
        /// 4. Product Chinese Name
        /// </summary>
        [Column(Name = "C_NAME")]
        public string CName { get; set; }

        /// <summary>
        /// 4. Product Chinese Name
        /// </summary>
        [Column(Name = "WEIGHT")]
        public double Weight { get; set; }


        [Column(Name = "WEIGHT_UNIT")]
        public string WeightUnit { get; set; }

        /// <summary>
        /// 7. Product Estimated Price
        /// </summary>
        [Column(Name = "ESTIMATED_POSTAGE")]
        public decimal Postage { get; set; }

        /// <summary>
        /// 6. Product Description
        /// </summary>
        [Column(Name = "DESCRIPTION")]
        public string Description { get; set; }

        /// <summary>
        /// 5. Product Keywords for search
        /// </summary>
        [Column(Name = "KEYWORDS")]
        public string Keywords { get; set; }

        /// <summary>
        /// 6. Product Description
        /// </summary>
        [Column(Name = "COLOR")]
        public string Color { get; set; }

        [Column(Name = "LIST_ORDER")]
        public int ListOrder { get; set; }

        /// <summary>
        /// 9. Product Thumbs Collection
        /// </summary>
        [Column(Name = "THUMBS")]
        public string Thumbs { get; set; }

        /// <summary>
        /// 10. Product Images Collection
        /// </summary>
        [Column(Name = "IMAGES")]
        public string Images { get; set; }
       
        /// <summary>
        /// 11. Additional Data field
        /// </summary>
        [Column(Name = "DATA")]
        public string Data { get; set; }

        /// <summary>
        /// 12. Enable this Product
        /// </summary>
        [Column(Name = "ENABLED")]
        public bool Enabled { get; set; }


        [Column(Name = "CREATOR_ID")]
        public string CreatorId { get; set; }

        /// <summary>
        /// 13. Date This Product Created
        /// </summary>
        [Column(Name = "DATE_CREATED")]
        public DateTime DateCreated { get; set; }
        

        /// <summary>
        /// 14. Date This Product Updated
        /// </summary>
        [Column(Name = "DATE_UPDATED")]
        public DateTime DateUpdated { get; set; }

    }
}